import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;

public class Map {

	double xPos1, yPos1, xPos2, yPos2;

	double xPos, yPos;

	double zoom = .5;

	Image backgroundImage = Toolkit.getDefaultToolkit().getImage("map.jpg"); // background

	// image
	// file

	public void setPos(double xPos, double yPos) {
		this.xPos = xPos;
		this.yPos = yPos;
		xPos1 = xPos - (250 * zoom);
		yPos1 = yPos - (250 * zoom);
		xPos2 = xPos + (250 * zoom);
		yPos2 = yPos + (250 * zoom);
	}

	public void drawTerrain(Graphics g) {
		g.drawImage(backgroundImage, 0, 0, 500, 500, (int) xPos1, (int) yPos1,
				(int) xPos2, (int) yPos2, null);

	}

	public void drawLine(Graphics g, int x, int y, int x2, int y2) {
		g.drawLine((int) ((x - xPos1) / zoom), (int) ((y - yPos1) / zoom),
				(int) ((x2 - xPos1) / zoom), (int) ((y2 - yPos1) / zoom));
	}

	public void fillOval(Graphics g, int x, int y, int x2, int y2) {
		g.fillOval((int) ((x - xPos1) / zoom), (int) ((y - yPos1) / zoom),
				(int) (x2 / zoom), (int) (y2 / zoom));
	}

}
